The present invention relates to data networks, and more particularly, to a method and apparatus for peeking at a portion of a frame or packet rather than the full packet.
Computer networks can be managed using a variety of techniques. Increasingly, it is becoming more desirable to actively manage computer networks, for example, to provide consistent service quality. However, in order to actively manage computer networks in an effective manner, systems must typically operate in the data path. In other words, systems must operate on the data packets to be forwarded. However, by operating on the packets to be forwarded, added delay is introduced in the packet forwarding process which can exacerbate network congestion.
FIG. 1 illustrates a system 10 located at a node of a data network. FIG. 1 illustrates an example of a system that operates in the data path. System 10 includes a controller 12 for controlling the operation of system 10, a forwarding engine 14 for forwarding packets received on line 18. Packets are output (forwarded) via line 20. Controller 12 and forwarding engine 14 can communicate via interface lines 16. Congestion is a common problem in data networks. Congestion occurs when there is more data to be carried over the network than the network can support.
There are several congestion control techniques that can be used to decrease network congestion. One common technique used to decrease network congestion is to discard packets. Because some packets have a higher priority or a greater importance than other packets, it may desirable to selectively discard certain packets over others. However, each of the packets must be analyzed to determine whether the packet should be discarded or forwarded.
Referring to the system of FIG. 1, a group of packets are input to forwarding engine 14 via line 18. The received packets are stored in a buffer 15 and then routed via path 21 to controller 12. At the application level, the packets can be analyzed by controller 12 to determine which packets should be discarded and which packets should be forwarded. The packets can be analyzed based upon application semantics. The packets are then each copied back to buffer 15 of forwarding engine 14 for forwarding on line 20.
While this selective discard technique can decrease congestion and loss in utility due to congestion, this technique can also increase the delay in the forwarding process. The critical forwarding path of the network is the data path which is input on line 18 and is output on line 20. A significant delay is introduced by moving each of the packets along path 21 from buffer 15 of forwarding engine 14 to the controller 12 and then back to buffer 15. This delay is very significant because the interface between controller 12 and forwarding engine 14 has a very limited bandwidth.
Moreover, in an Asynchronous Transfer Mode (ATM) network, controller 12 operates on application level frames, which can include many ATM cells. Therefore. in an ATM network, the ATM cells received on line 18 must typically be reassembled into application level frames. After the cells are reassembled into an application level frame, controller 12 can then analyze the data to determine whether the cells should be discarded or forwarded. The application level frame must then be segmented back into the separate ATM cells before moving the individual cells back to buffer 15 in forwarding engine 14. This reassembly and segmentation process further slows the forwarding task that must be performed by system 10.
System 10 of FIG. 1 can improve reception quality during congestion by operating in the data path to selectively discard less important packets and forward more important packets. However, this is done at the price of a significant delay incurred through the data path 21 that is routed through controller 12. There are many additional examples in which a data network can be actively managed by operating in the data path. As described above, fully operating in the data path can improve network control, but also significantly degrades forwarding performance of the system. Therefore, there is a need for a technique to operate on data in the data path without significantly degrading the forwarding performance of the system.
The present invention includes a method and apparatus for frame peeking that enables a controller to operate on data in the data path without significantly degrading the forwarding performance of the system. According to an embodiment of the present invention, the system includes a controller, a forwarding engine for forwarding packets, and an interface interconnecting the controller and the forwarding engine. The interface includes a subscribe/publish interface and a facility access interface. The subscribe interface allows the controller to request (subscribe) to receive a selected portion of a packet or packets of a flow. The publish interface allows the forwarding engine to publish the requested data to the controller. The facility access interface allows the controller to control packets stored in a buffer of the forwarding engine.
After the controller has subscribed to receive a portion of a packet, a copy of the portion of the received packet is provided to the controller. The controller may then analyze the received portion of the packet to determine how the packet should be controlled. The controller can then use the facility access interface to control the packet (e.g., discard or block the packet, reschedule the forwarding of the packet, allow the packet to be forwarded normally). Therefore, because only a selected portion of a packet is provided to the controller, the controller can operate on the data without significantly degrading the forwarding performance of the system.
In addition, frame peeking can be used at an end-system to reduce the number of copies that are made of a packet in memory and improve packet processing efficiency. In traditional layered data retrieval, two copies of a received packet must be made in memory. The end-system must first copy the packet into kernel memory and then determine which portion of user or application memory should receive the packet. The packet is then copy from kernel space into the specific user memory space. Thus, two copies must be made, thereby, creating additional packet processing and delay. According to an embodiment of the present invention, the end-system includes an interface card for receiving packets, a processor or controller and memory. The controller requests or subscribes to receive a portion of packets received at the interface card. Packets are received at the interface card and a portion of requested packets are provided to the controller. The controller identifies a location to store the packet in memory based on the portion of the packet. The packet is then stored in memory at the identified location. Thus, according to an embodiment of the present invention, only one copy of the packet is made in memory.